cmake_minimum_required(VERSION 3.16.3)

project(NetLib)

set(CXX_FLAGS
    -g
    # -DVALGRIND
    -DCHECK_PTHREAD_RETURN_VALUE
    -D_FILE_OFFSET_BITS=64
    -Wall
    -Wextra
    -Werror
    -Wconversion
    -Wno-unused-parameter
    -Wold-style-cast
    -Woverloaded-virtual
    -Wpointer-arith
    -Wshadow
    -Wwrite-strings
    -march=native
    # -MMD
    -std=c++11
    -rdynamic
    )

set(CMAKE_BUILD_TYPE Debug)

include_directories(./lib_include)

include_directories(./usr_include)

aux_source_directory(./usr_src USR_SRC)

add_executable(NetLib ${USR_SRC})

find_library(MYLIB libnetlib.so ./lib/)

target_link_libraries(NetLib pthread)

target_link_libraries(NetLib ${MYLIB})

find_library(MYSQL libmysqlclient.so /usr/lib64/mysql)

target_link_libraries(NetLib ${MYSQL})